import {getAction} from '@/request/BaseRequest';
import {isEmpty, listToTrees} from '@/utils/CommonUtils';

export const getAllusers = (params) => getAction('/base/baseUser/list', params);
export const loadUnits = () => {
  return new Promise((success, err) => {
    getAction('/sys/unit/loadUnits').then(data => {
      let result = data.result;
      if (isEmpty(result)) {
        result = [];
      }
      success(listToTrees(result));
    }).catch(err);
  });
};
